#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>

#include <qnamespace.h> 
#include <qwidget.h>
#include <qtimer.h>
#include <qtoolbar.h>
#include <qdir.h>

#include <ZApplication.h>
#include "dstview.h"

int main(int argc, char** argv)
{
    ZApplication::setColorSpec( QApplication::CustomColor );
    ZApplication app( argc, argv );
    char APPDIR[55];
    strncpy(APPDIR,argv[0],strlen(argv[0])-3);
    dbg_printf("%s\n",argv[0]);
    QDir::setCurrent(APPDIR);

    QString filename;
    if ( app.argc() > 1 )
    {
        printf("path is %s",app.argv()[2]);
        filename = QString::fromLocal8Bit(app.argv()[2]);
    }
    else
    {
        filename = QString("%1/null.DST").arg(APPDIR);
    }

    DWidget *w = new DWidget(0,"w");
    //app.setMainWidget( w );
    w->show();
    printf("%d %d \n",w->visibleRect().height(),w->visibleRect().width());
    w->init(filename);
    return app.exec();
}

